<template>
	<view class="content">
		<u-form style="width: 90vw;">
			<u-form-item label="头像">
				<u-avatar :src="userInfo.avatar" size="50" shape="square"></u-avatar>
			</u-form-item>
			<u-form-item label="姓名">
				<u-input :placeholder="userInfo.name" required></u-input>
			</u-form-item>
			<u-form-item label="电话">
				<u-input :placeholder="userInfo.phone" required></u-input>
			</u-form-item>
		</u-form>
	</view>
</template>

<script setup>
	import { useGlobalStore } from '@/stores/global.js'
	import { getCurUser } from '@/api/member.js'
	import { onLoad } from '@dcloudio/uni-app'
	import { ref } from "vue"
	

	const globalStore = useGlobalStore()
	const userInfo = ref({})
	
	async function curUser(){
		const res = await getCurUser();
		userInfo.value = res.data;
	}
	
	onLoad(() => {
		curUser();
	})
	
</script>

<style>
.content{
	width: 100vw;
	display: flex;
	flex-direction: column;
	align-items: center;
}	
</style>